#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, k;
  cin >> n >> k;
  int a[n];
  map<int, int> mp;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    mp[a[i]]++;
  }
  vector<int> v;  // 直接在 map 里统计很麻烦，用 vector 更简单
  for (auto [x, c] : mp)
    if (c >= k) v.push_back(x);

  if (v.empty()) {
    cout << -1 << endl;
    return;
  }

  sort(v.begin(), v.end());
  int mx = 0;
  int lans = v[0], rans = v[0];
  int l = v[0];
  for (int i = 1; i < v.size(); ++i) {
    if (v[i] - 1 == v[i - 1]) {
      if (v[i] - l > mx) {
        lans = l;
        rans = v[i];
        mx = v[i] - l;
      }
    } else {
      l = v[i];
    }
  }
  cout << lans << ' ' << rans << endl;
}
int main() {
  int t;
  cin >> t;
  while (t--) solve();
}
